package com.zhongkun.datahome.service.constant;

import lombok.Getter;

/**
 * @Author: lifengsheng
 * @Date: 2025/4/15 11:25
 * @Desc
 */
@Getter
public enum SkuStatusEnum {
    OFF_SHELF(0, "下架"),
    ON_SHELF(1, "上架");

    private Integer status;

    private String desc;

    SkuStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public boolean is(Integer status) {
        return this.status.equals(status);
    }

    public static String getDesc(Integer status) {
        for (SkuStatusEnum statusEnum : SkuStatusEnum.values()) {
            if (statusEnum.is(status)) {
                return statusEnum.desc;
            }
        }
        return null;
    }
}
